import sys

dow = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
m31 = {0,2,4,6,7,9,11}
m30 = {3,5,8,10}
START = [1,1,1901]
END = [31,12,2000]
def is_leap_year(year):
	return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)

def days_in_month(month,year):#0 = January, 11 = December
	if month in m31:
		return 31
	elif month in m30:
		return 30
	elif is_leap_year(year):
		return 29
	else:
		return 28

def get_dow(date):#for later implimentation ASSUMES DATE IS AFTER EPOCH
	epoch = [0,0,1900] #[(day-1),(month-1),year] -- January 1, 1990 -- IS MONDAY (0)
	x = 0 #Set epoch to Monday
	dt = [date[0]-1,date[1]-1,date[2]]
	for y in range(epoch[2],dt[2]+1):
		if y == epoch[2]:
			m1 = epoch[1]
		else:
			m1 = 0
		if y == dt[2]:
			m2 = dt[1]+1
		else:
			m2 = 12
		for m in range(m1,m2):
			if y == epoch[2] and m == epoch[1]:
				d1 = epoch[0]
			else:
				d1 = 0
			if y == dt[2] and m == dt[1]:
				d2 = dt[0]
			else:
				d2 = days_in_month(m,y)
			for d in range(d1,d2):
				x = (x + 1) % 7
	return x


x = get_dow([1,1,1997])
print(dow[x])

x = get_dow(START)
#print(dow[x])
nsun = 0

for y in range(START[2],END[2]+1):
	sd = START[0]-1
	sm = START[1]-1
	sy = START[2]
	ed = END[0]-1
	em = END[1]-1
	ey = END[2]
	if y == sy:
		m1 = sm
	else:
		m1 = 0
	if y == ey:
		m2 = em
	else:
		m2 = 12
	for m in range(m1,m2):
		if y == sy and m == em:
			d1 = sd
		else:
			d1 = 0
		if y == ey and m == em:
			d2 = ed
		else:
			d2 = days_in_month(m,y)
		for d in range(d1,d2):
			if x == 6 and d == 0:
				nsun = nsun + 1
#				print(str(m+1)+"/"+str(d+1)+"/"+str(y)+" "+dow[x])
			x = (x + 1) % 7
print(str(nsun)+" Sundays")